package com.wq.httpclientcore.model;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 用于封装 HTTP 请求响应的通用包装类
 *
 * @author wangqing
 * @param <T> 响应结果的数据类型
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(name = "HttpResponseWrapper", description = "HTTP 响应包装类，包含响应结果、状态码和错误信息")
public class HttpResponseWrapper<T> {
    @Schema(description = "响应结果数据", required = false)
    private T result;
    @Schema(description = "HTTP 状态码", required = true)
    private int statusCode;
    @Schema(description = "错误信息，若请求成功则为 null", required = false)
    private String errorMessage;
    @Schema(description = "数据条数", required = false)
    private Integer dataCount;
}